#include "StdAfx.h"
#include "MyLinkList.h"



Nodelinklist *MyLinkList::CreateNode(int data)
{
	Nodelinklist * PNew;
	PNew = new Nodelinklist;
	if(PNew == NULL)
		return NULL;
	PNew->data = data;
	PNew->Pnext = NULL;
	return PNew;
}

void MyLinkList::InitList()
{
	ml.Phead = NULL;
	ml.Ptail = NULL;
}

bool MyLinkList::AddNode(int a)
{
	Nodelinklist *PCur;
	PCur = CreateNode(a);
	if(ml.Phead == NULL)
	{
		ml.Phead = PCur;
		ml.Ptail = ml.Phead;
	}
	else
	{
		PCur->Pnext = ml.Phead;
		ml.Phead = PCur;
	}
	return true;
}

MyLinkList::MyLinkList(void)
{

}


MyLinkList::~MyLinkList(void)
{
}
